/ _ \ \_\(_)/_/ _//"\\_ more on JOHLEM.net / \ 0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0 Service Management Commands: ----------------------------- 1. **Get-Service** Display the status of services on the system. Syntax: Get-Service -Name "ServiceName" Example: Get-Service -Name "wuauserv" 2. **Start-Service** Start a service. Syntax: Start-Service -Name "ServiceName" Example: Start-Service -Name "wuauserv" 3. **Stop-Service** Stop a service. Syntax: Stop-Service -Name "ServiceName" Example: Stop-Service -Name "wuauserv" 4. **Restart-Service** Restart a service. Syntax: Restart-Service -Name "ServiceName" Example: Restart-Service -Name "wuauserv" 5. **Set-Service** Configure a service’s startup type (Automatic, Manual, Disabled). Syntax: Set-Service -Name "ServiceName" -StartupType "Automatic" Example: Set-Service -Name "wuauserv" -StartupType "Automatic" 6. **New-Service** Create a new service. Syntax: New-Service -Name "ServiceName" -BinaryPathName "C:\Path\To\Executable.exe" -DisplayName "Service Display Name" -StartupType "Automatic" Example: New-Service -Name "MyService" -BinaryPathName "C:\Program Files\MyApp\MyService.exe" -DisplayName "My Custom Service" -StartupType "Automatic" 7. **Remove-Service** Delete an existing service (requires PowerShell 6.0+ or manual removal from the registry). Syntax: Remove-Service -Name "ServiceName" Example: Remove-Service -Name "MyService" 8. **Get-Service** with Status Display services with a specific status (Running, Stopped). Syntax: Get-Service | Where-Object { $_.Status -eq "Running" } 9. **Get-Service** by Display Name Search for services by display name. Syntax: Get-Service | Where-Object { $_.DisplayName -like "*Keyword*" } 10. **Suspend-Service** Pause a running service (if supported by the service). Syntax: Suspend-Service -Name "ServiceName" 11. **Resume-Service** Resume a paused service. Syntax: Resume-Service -Name "ServiceName" 12. **Get-WmiObject** (Alias: `gwmi`) Query service information via WMI. Syntax: Get-WmiObject -Class Win32_Service -Filter "Name='ServiceName'" Example: Get-WmiObject -Class Win32_Service -Filter "Name='wuauserv'" +----------------------------------------------------------+ | Note: Service management commands allow for control of | | system services, enabling start, stop, and config-| | uration directly from PowerShell. | +----------------------------------------------------------+